"use strict";
// 类使用implements关键字，实现接口。实现接口之后，必须实现接口中定义的方法。
class Animal {
    constructor(name, age) {
        this.name = name;
        this.age = age;
    }
    getPrice() {
        if (this.age <= 10) {
            return 1000;
        }
        else {
            return 10;
        }
    }
    getName() {
        return this.name;
    }
}
class SuperMark {
    constructor(name) {
        this.name = name;
    }
    sell(goods) {
        console.log(`${this.name}销售了：${goods.getName()}，赚了：${goods.getPrice()}元！`);
    }
}
let cat = new Animal("哆啦A梦", 1);
let dog = new Animal("苏比狗", 1);
let superMark = new SuperMark("沃尔玛");
superMark.sell(cat);
superMark.sell(dog);
